{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
    {if condition="$id eq 0"}
    <h3 class="pb-3">新增对比度</h3>
    <table class="layui-table layui-table-form">
        <tr>
            <td class="layui-td-gray-2">股票代码<font>*</font></td>
            <td colspan="2">
                <input type="text" name="codes"  lay-verify="required" placeholder="请输入股票代码"  class="layui-input" value="" >
            </td>

        </tr>
        <tr>
            <td class="layui-td-gray-2">名称<font>*</font></td>
            <td colspan="2">
                <input type="text" name="name"  lay-verify="required" placeholder="请输入名称"  class="layui-input" value="" >
            </td>
        </tr>

        <tr>
            <td class="layui-td-gray-2">揭露日<font>*</font></td>
            <td colspan="2">
                <input type="text" name="jielu_date"  lay-verify="required" placeholder="请输入揭露日"  class="layui-input tool-time" value="" >
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">基准日<font>*</font></td>
            <td colspan="2">
                <input type="text" name="jizhun_date"  lay-verify="required" placeholder="请输入基准日"  class="layui-input tool-time" value="" >
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">造假实施日</td>
            <td colspan="2">
                <input type="text" name="shishi_date"  lay-verify="required" placeholder="请输入造假实施日"  class="layui-input tool-time" value="" >
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">基准日股价<font>*</font></td>
            <td colspan="2">
                <input type="text" name="price" lay-verify="required" placeholder="请输入基准日股价"  class="layui-input">
            </td>

        </tr>

    </table>
    {else/}
    <h3 class="pb-3">修改对比度</h3>
    <table class="layui-table layui-table-form">
        <tr>
            <td class="layui-td-gray-2">股票代码<font>*</font></td>
            <td colspan="2">
                <input type="text" name="codes"  lay-verify="required" placeholder="请输入股票代码"  class="layui-input" value="{$data.codes}" >
            </td>

        </tr>
        <tr>
            <td class="layui-td-gray-2">名称<font>*</font></td>
            <td colspan="2">
                <input type="text" name="name"  lay-verify="required" placeholder="请输入名称"  class="layui-input" value="{$data.name}" >
            </td>
        </tr>

        <tr>
            <td class="layui-td-gray-2">揭露日<font>*</font></td>
            <td colspan="2">
                <input type="text" name="jielu_date"  lay-verify="required" placeholder="请输入揭露日"  class="layui-input tool-time" value="{$data.jielu_date}" >
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">基准日<font>*</font></td>
            <td colspan="2">
                <input type="text" name="jizhun_date"  lay-verify="required" placeholder="请输入基准日"  class="layui-input tool-time" value="{$data.jizhun_date}" >
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">造假实施日</td>
            <td colspan="2">
                <input type="text" name="shishi_date"  lay-verify="required" placeholder="请输入造假实施日"  class="layui-input tool-time" value="{$data.shishi_date}" >
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">基准日股价<font>*</font></td>
            <td colspan="2">
                <input type="text" name="price" lay-verify="required" placeholder="请输入基准日股价" value="{$data.price}" class="layui-input">
            </td>
        </tr>
    </table>
    {/if}

    <div class="py-3">
        <input type="hidden" name="id" value="{$id}" />
        <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
    const moduleInit = ['tool'];
    function gouguInit() {
        var form = layui.form,tool=layui.tool,upload = layui.upload;

        //监听提交
        form.on('submit(webform)', function (data) {
            let callback = function (e) {
                layer.msg(e.msg);
                if (e.code == 0) {
                    setTimeout(function () {
                        parent.location.reload();
                    }, 1000);
                }
            }
            tool.post("/webadmin/duibidu/add", data.field, callback);
            return false;
        });
    }
</script>
{/block}
<!-- /脚本 -->
